package com.ruix.app.widget;

import android.content.Context;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;

import com.ruix.app.model.WebParcel;
import com.ruix.app.ui.CommonWebActivity;
import com.ruix.app.ui.stratum.CircleTagActivity;

/**
 * Created by hadexs on 2017/5/31.
 */

public class TagClickableSpan extends ClickableSpan {

    //ClickableSpan
    //ClickableSpanEx
    private String tag;

    public TagClickableSpan(String tag) {
        this.tag = tag;
//        super(builder.color, builder.clickEventColor);
    }

    @Override
    public void onClick(View widget) {
        Context context =  widget.getContext();
        widget.getContext().startActivity(CircleTagActivity.newIntent(context, tag));

    }

    @Override
    public void updateDrawState(TextPaint ds) {
//        super.updateDrawState(ds);
        ds.setColor(0xFF307E9E);
        ds.setUnderlineText(false);
    }
}
